<%@ page import="model.User" %>
<%@ page import="model.Recipe" %>
<%@ page import="util.CSSDisplay" %>
<%@ page language="java" import="java.util.*" %>

	<form action="<%=request.getContextPath() %>/ServletController?event=ADD_COMMENT" method="post">
	<input type="hidden" name="user_id" value="<%=request.getAttribute("user_id")%>" />
	<input type="hidden" name="recipe_id" value="<%=request.getAttribute("recipe_id")%>" />
	<input type="hidden" name="category_id" value="<%=request.getAttribute("category_id")%>" />
	
	<h3>Ajout d'un commentaire</h3>
	<hr/>
	<%
		String responseMsg = (String) request.getAttribute("responseMsg");
		if (responseMsg != null && responseMsg != "") {
			out.print("<br/><center><label class=\"message\">"+ responseMsg+"</label></center><br/>");
		}
	%>
	<br />  
	<table>
		<tr>
			<td  valign="top"><label>Titre </label></td>	
			<td>
				<input id="capitalize" class ="input_text" type="text" name="title" value="<%=CSSDisplay.getValueOf("title", request)%>" />
				<div style="<%=CSSDisplay.getStyleOf("COMMENT_TITLE_NOT_NULL", request)%>"><label  class="Error"><%=request.getAttribute("COMMENT_TITLE_NOT_NULL") %><br/><br/></label></div>
			</td>	
		</tr>
		<tr>
			<td valign="top"><label>Description</label> </td>	
			<td>
				<textarea class="addComment" name="description"><%=CSSDisplay.getValueOf("description", request)%></textarea>
				<div style="<%=CSSDisplay.getStyleOf("COMMENT_DESCRIPTION_NOT_NULL", request)%>"><label  class="Error"><%=request.getAttribute("COMMENT_DESCRIPTION_NOT_NULL") %><br/><br/></label></div>
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center">
	        	<input type="reset" value="Annuler" />
	        	<input type="submit" value="Enregistrer" />
			</td>
		</tr>
	</table>
	</form>


